package com.wjv.example.spbt.shiro.controller;

import com.wjv.example.common.ResultInfo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>Title: HomeController</p>
 *
 * @author wjv
 * @date 2021/7/5 11:43
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @RequiresPermissions("user:item")
    @GetMapping("/item")
    public ResultInfo index(int id) {
        return ResultInfo.success("user: " + id);
    }

    @RequiresPermissions("user:list")
    @GetMapping("/list")
    public ResultInfo list() {
        return ResultInfo.success("user: list");
    }

    @RequiresPermissions("user:create")
    @GetMapping("/create")
    public ResultInfo create() {
        return ResultInfo.success("user: create");
    }

}
